<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>焦点学苑</title>
<link rel="stylesheet" href="__STATIC__/index/css/base.css">
<link rel="stylesheet" href="__STATIC__/index/css/style.css">
    <link href="__STATIC__/admin/assets/css/bootstrap.min.css" rel="stylesheet" />
    <script src="__STATIC__/admin/js/jquery-1.9.1.min.js"></script>
    <script src="__STATIC__/admin/js/bootstrap.min.js"></script>
    <script src="__STATIC__/admin/assets/layer/layer.js" type="text/javascript"></script>

</head>

<body>
<div class="head-box">
    <div class="head wrap">
          <div class="logo fl"><a href=""><img src="__STATIC__/index/images/logo.png"></a></div>
          <div class="head-right fr">
              <div class="head-a fr">
                  {if condition='$user'}
                  <div class="head-a1 fl"><a href=""><img src="__STATIC__/index/images/tb-a.png"></a></div>
                  <div class="head-a1 fl"><a href=""><img src="__STATIC__/index/images/tb-b.png"></a></div>
                  <div class="tbt fl"><img src="__UPLOAD__/user/{$user.image_thumb}" style="width: 30px;">
                      <div class="hgt-btm">
                          <a href="{:url('user/collection',['user_id'=>$user.user_id])}">我的主页</a>
                          <a href="">消息</a>
                          <a href="">我的关注</a>
                          <a href="{:url('user/account',['user_id'=>$user.user_id])}">帐号设置</a>
                          <a href="{:url('user/logon')}">退出</a>
                      </div>
                  </div>

                  {else}
                  <div class="head-a1 fl"><a href=""><img src="__STATIC__/index/images/tb-a.png"></a></div>
                  <div class="head-a1 fl"><a href=""><img src="__STATIC__/index/images/tb-b.png"></a></div>
                  <div class="head-a3 fl"><a href="{:url('login/index')}">登录</a></div>
                  <div class="head-a4 fl"><a href="{:url('login/login')}">注册</a></div>
                  {/if}


              </div>
              <div class="clearfix"></div>
              <div class="nav fr">
                  <ul>
                      <li><a href="{:url('index/index')}">首页</a></li>
                      <li class="nav-cut"><a href="{:url('question/article')}">文章</a>
                      </li>
                  </ul>
              </div>
              <div class="clearfix"></div>
          </div>
    </div>
</div>

<div class="content">
    <div class="wrap">
            <div class="tsm-height"></div>
            <div class="post">

                <a href="javascript:;" id="scsc">收藏</a>
                   <div class="post-fl fl">

                         <div class="post-a1">{$question.q_title}</div>
                         <div class="post-a2">{$question.user_id}<span>{$question.create_time|date="Y-m-d H:i:s",###}</span><span>{$cltn.aa}人已收藏</span><span>点击数{$question.click}</span>
                                               <div class="col-c">
                                                    <span><img src="__STATIC__/index/images/col-c1.jpg">0</span>
                                                    <span><img src="__STATIC__/index/images/col-c2.jpg">3</span>
                                                    <em><img src="__STATIC__/index/images/col-c3.jpg"></em>
                                                    <em><img src="__STATIC__/index/images/col-c4.jpg"></em>
                                                    <em><img src="__STATIC__/index/images/col-c5.jpg"></em>
                                                </div>
                         </div>

                         <div class="post-b">
                               {$question.q_desc}
                         </div>
                       <input type="hidden" name="user_id" id="user_id" value="{$user_id}">
                       <input type="hidden" name="q_id" id="q_id" value="{$q_id}">

                         <div class="det-b">
                                 <div class="det-title"><img src="__STATIC__/index/images/cou-b1.jpg">在线评论</div>
                                 <div class="det-b1">
                                     {if condition="$user"}
                                     <textarea class="det-area post-area" name="title" id="plplpl" placeholder="请输入评论"></textarea>
                                     <div class="det-b3"><input type="button" class="det-btn" id="fbpl" value="发表"></div>
                                     {else}
                                     <div class="det-area post-area"></div>
                                     <div class="det-b2"><a href="{:url('login/index')}">登录</a>发表</div>
                                     {/if}
                                 </div>

                          </div>
                         <div class="skt">
                 <div class="skt-title">
                       <span class="skt-cut">最新评论</span>
                 </div>
                 <div class="skt-tab">
                          <div class="skt-btm">
                               <ul class="skt-ul" id="pl111">
                                   <li>

                                       <div class="skt-a1"><img src="__UPLOAD__/user/{$comc.image_thumb}"><span style="color:red;">{$comc.user_name}
                                           </span>
                                           <div class="menu">发布时间:{$comc.create_time|date="Y-m-d H:i:s",###}
                                               {if condition='$user_id==$question.user_id'}
                                               <a href="javascript:;" class="cdel" data-cid="{$comc.c_id}">
                                                   <img src="__STATIC__/index/images/menu.jpg">
                                               </a>
                                               {else}
                                               <a href="">
                                                   <img src="__STATIC__/index/images/menu.jpg">
                                               </a>
                                               {/if}

                                           </div></div>
                                       <div class="skt-a2">{$comc.title}<span style="float: right;font-size: 12px;color: red;">置顶评论</span></div>
                                       <div class="skt-a3"><a href=""><img src="__STATIC__/index/upload/det-b.jpg">我要点评</a>
                                           <div class="menu-a">
                                               <img src="__STATIC__/index/images/menu-a1.jpg" class="dzdz" data-dz="{$comc.dz}" data-id="{$comc.c_id}">
                                               <span class="dzshu{$comc.c_id}">{$comc.dz}</span>
                                           </div>
                                       </div>
                                   </li>
                                     
                                      {foreach $coment as $item}
                                   <li>

                                       <div class="skt-a1"><img src="__UPLOAD__/user/{$item.image_thumb}"><span style="color:red;">{$item.user_name}
                                           </span>
                                           <div class="menu">发布时间:{$item.create_time|date="Y-m-d H:i:s",###}
                                               {if condition='$user_id==$question.user_id'}
                                               <a href="javascript:;" class="cdel" data-cid="{$item.c_id}">
                                                   <img src="__STATIC__/index/images/menu.jpg">
                                               </a>
                                               {else}
                                               <a href="">
                                               <img src="__STATIC__/index/images/menu.jpg">
                                               </a>
                                               {/if}

                                           </div></div>
                                       <div class="skt-a2">{$item.title}</div>
                                       <div class="skt-a3"><a href=""><img src="__STATIC__/index/upload/det-b.jpg">我要点评</a>
                                           <div class="menu-a">
                                               <img src="__STATIC__/index/images/menu-a1.jpg" class="dzdz" data-dz="{$item.dz}" data-id="{$item.c_id}">
                                               <span class="dzshu{$item.c_id}">{$item.dz}</span>
                                               </div>
                                       </div>
                                   </li>
                                   {/foreach}
                               </ul>
                              <div class="row">

                                  <div class="col-sm-6">
                                      <div class="dataTables_info">{$coment->render()}</div>
                                  </div>
                              </div>
                          </div>
                      
                          <div class="skt-btm hide">
                               222
                          </div>
                 </div>
           </div>      
                   </div><!--post-fl-->
                   <div class="post-fr fr">
                           <div class="art-a"><a href=""><img src="__STATIC__/index/upload/art-a.jpg"></a></div>
                           <div class="post-t"><a href=""><img src="__STATIC__/index/upload/post-a3.jpg"></a></div>
                           <div class="post-y">
                                 <div class="post-y1"><img src="__STATIC__/index/images/cou-b1.jpg">热门帖子</div>
                                 <ul>
                                     {foreach $coll_ques as $item}
                                      <a href="{:url('question/question',['q_id'=>$item.q_id,'user_id'=>$user.user_id])}"><li>
                                           <div class="post-y2"><img src="__UPLOAD__/question/{$item.image_thumb}"></div>
                                           <div class="post-y3">{$item.q_title} <span>{$item.click}点击</span></div>
                                          <div class="post-y3" ><span style="color:red;">{$item.user_name}</span> <span>{$item.create_time|date="Y-m-d H:i:s",###}发表</span></div>
                                      
                                      </li></a>
                                     {/foreach}
                                 </ul>
                           </div>
                   </div>
            </div>
    </div>      
</div>

<div class="footer">
   <div class="wrap">
      <div class="foot">
            <div class="foot-left fl">
                 <a href="">关于我们</a>
                 <a href="">加入我们</a>
                 <a href="contact.html">联系我们</a>
                 <a href="">媒体采访</a>
            </div>
            <div class="foot-c fl"><a href=""><img src="__STATIC__/index/images/foot-logo.jpg"></a></div>
            <div class="foot-right fr">
                 <a href="">同城活动</a>
                 <a href="">课程资讯</a>
                 <a href="">最新发布</a>
                 <a href="">热门文章</a>
            </div>
       </div>
   </div>
</div>





<script src="__STATIC__/index/js/Action.js"></script>
<script>
    $(".skt-title span").click(function(){
		 $(this).addClass("skt-cut").siblings().removeClass("skt-cut"),
		 $(".skt-tab .skt-btm").hide().eq($(".skt-title span").index(this)).show()
    });
    $('#fbpl').on('click',function () {
        var comment = $('#plplpl').val();
        if (comment == '') {
            alert('请输入评论');
            return false;
        };

        var url="{:url('question/coment')}";
        var data={q_id:$('#q_id').val(),user_id:$('#user_id').val(),comment:comment};

        $.post(url,data,function (res) {
            if(res.status==1){
                var li='<li><div class="skt-a1"><img src="__UPLOAD__/user/'+res.image_thumb+'"><span style="color:red;">'+res.name+'</span><div class="menu">发布时间:'+res.create_time+'<ahref=""><imgsrc="__STATIC__/index/images/menu.jpg"></a></div></div><div class="skt-a2">'+res.comment+'</div><div class="skt-a3"><a href=""><img src="__STATIC__/index/upload/det-b.jpg">我要点评</a><div class="menu-a"><img src="__STATIC__/index/images/menu-a1.jpg">0</div></div></li>';
                $('#pl111').prepend(li);
                layer.msg('发表成功',{
                    title:'提示',
                    icon:6
                })
            }else{
                layer.msg('发表失败',{
                    title:'提示',
                    icon:4
                })
            }
        },'json')
    });
    $('.dzdz').on('click',function () {
        if($('#user_id').val()==''){
            parent.layer.msg('请先登录',{
                title:'提示',
                icon:4
            });
            return;
        }
        var c_id=$(this).data('id');
        var dz=$(this).data('dz');
        var url="{:url('question/dzdz')}";
        var data={c_id:c_id,dz:dz,q_id:$('#q_id').val()};
        $.post(url,data,function (res) {
            if(res.status==1){
                parent.layer.msg('点赞成功',{
                    title:'提示',
                    icon:6
                })
            }else{
                lparent.layer.msg(res.msg,{
                    title:'提示',
                    icon:4
                })
            }
        },'json');
    });

    $('#scsc').on('click',function () {
        var that=$(this);


        sc(that);

    });
    function sc(that){
        var question_id=$('#q_id').val();
        var url="{:url('question/scsc')}";
        var data={question_id:question_id,user_id:$('#user_id').val()};
        $.post(url,data,function (res) {
            if(res.status==1){
                $(that).text('已收藏');
                parent.layer.msg('收藏成功',{
                    title:'提示',
                    icon:6
                })
            }else{
                parent.layer.msg(res.msg,{
                    title:'提示',
                    icon:4
                })
            }
        },'json');
    };
    $('.cdel').on('click',function () {
        var that=$(this);
        parent.layer.confirm('真的那么狠心吗?',{icon:3,title:'错误提示'},function (index) {
            del(that);
            parent.layer.close(index);
        });

    });
    function del(that){
        var c_id=$(that).data('cid');
        var url="{:url('question/cdel')}";
        var data={c_id:c_id};
        $.post(url,data,function (res) {
            if(res.status==1){
                $(that).parent().parent().parent().remove();
                parent.layer.msg('删除成功',{
                    title:'提示',
                    icon:6
                })
            }else{
                parent.layer.msg('删除失败',{
                    title:'提示',
                    icon:4
                })
            }
        },'json');
    };
</script>
</body>
</html>

